package com.whfc.fmam.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xuguocheng
 * @desc 自定义WebMvcConfigurer
 * @date 2019-08-03
 */
@Configuration
public class CustomWebMvcConfigurer implements WebMvcConfigurer {

    @Autowired
    private MamClientIntercepter wxUserIntercepter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(wxUserIntercepter)
                .addPathPatterns(
                        "/fmam/api/**",
                        "/open/api/fmam/**")
                .excludePathPatterns(
                        "/fmam/api/license/active",
                        "/fmam/api/accessToken",
                        "/open/api/fmam/license/active",
                        "/open/api/fmam/accessToken");
    }
}
